package com.dq.eduservice.client;

import com.dq.commonutils.vo.Result;
import com.dq.eduservice.client.fallback.VodClientFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 1. 使用Feign maven坐标引入
 * 2. 写调用服务的名称
 * 3. 和相应的接口声明
 * @project: guli_parent
 * @ClassName: VodClient
 * @author: dq
 * @creat: 2022/8/1 9:20
 */
@FeignClient(name = "service-vod",fallbackFactory = VodClientFallBackFactory.class)
@Component
public interface VodClient {

    /**
     * 微服务引入Vod中的方法
     * @param videoSourceId
     * @return
     */
    @PostMapping("/eduvod/video/deleteAliyunViedo/{videoSourceId}")
    public Result deleteAliyunViedo(@PathVariable("videoSourceId") String videoSourceId);

    /**
     * 删除多个小节视频
     * @param videoIdList
     * @return
     */
    @PostMapping("/eduvod/video/deleteAliyunVideoBatch")
    public Result deleteAliyunVideoBatch(@RequestParam("videoIdList") List<String> videoIdList);
}
